package edu.ahut.designpattern.chainresponsibility.joke;

public class Application {
    public static void main(String[] args) {
        //创建处理节点
        GirlHandler[] girlHandlers = new GirlHandler[]{
                new BeautifulGirlHandler("Alice"),
                new SmartGirlHandler("Cathy"),
                new RobustGirlHandler("Juice")
        };
        //构建处理链表
        girlHandlers[0].setNextHandler(girlHandlers[1]);
        girlHandlers[1].setNextHandler(girlHandlers[2]);

        String loveLetter = "I am a plain boy, do you like to be my girlfriend?";

        //头结点来处理信息
        girlHandlers[0].handle(loveLetter);
    }
}
